//
//  RedView.m
//  FRP_OC
//
//  Created by DeLong Yang on 2017/8/8.
//  Copyright © 2017年 DeLongYang. All rights reserved.
//

#import "RedView.h"

@implementation RedView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(0, 0, frame.size.width/2.0, frame.size.height);
        [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        btn.backgroundColor = [UIColor redColor];
        [self addSubview:btn];
        
        _string = @"Hello_DeLong";
        
    }
    return self;
}

// btn click
- (void)btnClick:(UIButton *)btn
{
    NSLog(@"btn clicked ");
}


@end
